package com.cf.wmsg;

import com.cf.wmsg.controller.WebMessageFrontController;
import com.cf.wmsg.model.WebMessageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * boot-message-WebMessageConfig
 *
 * @author <a href="2428922347@qq.com">Zhu mingming</a>
 * @info
 * @since 2018/7/12 下午 03:07
 */
@Slf4j
@Configuration
public class WebMessageConfig {

    @Bean
    public WebMessageService webMessageService() {
        log.info("实例化WebMessageService");
        return new WebMessageService();
    }

    @Bean
    @ConditionalOnProperty(value = "zmm.web-message.front", havingValue = "true")
    public WebMessageFrontController webMessageFrontController() {
        log.info("实例化WebMessageFrontController");
        return new WebMessageFrontController();
    }

}
